class Sum{
public:
    Sum()    // 构造函数
    {
        n++;
        ret += n;
    }
    static int GetSum()
    {
        return ret;
    }
    static void ReSet()  //重置 sum 和 n
    {
        n = 0;
        ret = 0;
    }
private:
    static int n;   //累加元素
    static int ret;   //返回的和
};

int Sum::n = 0;
int Sum::ret = 0;

class Solution {
public:
    int Sum_Solution(int n) {
        Sum::ReSet();
        Sum* p = new Sum[n];
        delete [] p;
        return Sum::GetSum();
    }
    
};